index :: Int -> Int -> [Int] -> Int
index _ _ [] = -1
index acc x (y:ys) = if x == y then acc else index (acc+1) x ys

main = do
    n <- getLine
    _ <- getLine
    m <- getLine
    let num = read n
        xs = map read $ words m
    print $ index 0 num xs
    